﻿package src.index_copa{
	import flash.display.*;
	import flash.events.*;
	import flash.filters.*;
	import caurina.transitions.*;
	import caurina.transitions.properties.*;
	public class Circle extends MovieClip {
		private var tw:Number;
		private var th:Number;
		private var total_colors:Number = 4;
		public function Circle() {
			ColorShortcuts.init();
			tw = this.width;
			th = this.height;
			this.filters = gS(0, 0.5);
			this.addEventListener(MouseEvent.MOUSE_OVER, overHd);
			//randomColor();
		}
		private function overHd(e:Event):void {
			this.removeEventListener(MouseEvent.MOUSE_OVER, overHd);
			Tweener.addTween(this, {width:3, height:3, time:0.5, transition:"easeInQuint", onComplete:changeHd});
		}
		private function changeHd():void {
			//randomColor();
			Tweener.addTween(this, {width:tw, height:th, time:1, transition:"easeoutelastic", onComplete:completeHd});
		}
		private function randomColor():void {
			var theframe:Number = Math.round(total_colors*Math.random());
			this.gotoAndStop(theframe);
		}
		private function completeHd():void{
			this.addEventListener(MouseEvent.MOUSE_OVER, overHd);
		}
		public function goto(num:int):void {
			this.gotoAndStop(num);
			
		}
		//滤镜
		public function gS(c:Number,a:Number,distance:Number = 1.0, angle:Number = 45, blurX:Number = 4.0, blurY:Number = 4.0, strength:Number = 1.0, quality:int = 1, inner:Boolean = false, knockout:Boolean = false, hideObject:Boolean = false):Array {
			//distance:Number = 4.0, angle:Number = 45, color:uint = 0, alpha:Number = 1.0, blurX:Number = 4.0, blurY:Number = 4.0, 
			//strength:Number = 1.0, quality:int = 1, inner:Boolean = false, knockout:Boolean = false, hideObject:Boolean = false
			return new Array(new DropShadowFilter(distance,angle,c,a,blurX,blurY,strength,quality,inner,knockout,hideObject));
		}

	}
}